package com.example.customannotate.controller;

import cn.hutool.core.util.StrUtil;
import com.example.customannotate.aop.RunTimeRecord;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 控制层
 * @author zhouzhaodong
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @RunTimeRecord(value = "测试该方法流程", level = "DEBUG")
    @GetMapping("/hello")
    public String sayHello(String oneName, String twoName) {
        String str = "Hello: ";
        if (StrUtil.isNotBlank(oneName)) {
            str += oneName + ", ";
        }
        if (StrUtil.isNotBlank(twoName)) {
            str += twoName;
        }
        return str;
    }

}
